<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport"	content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<link rel="stylesheet"	href="${pageContext.request.contextPath}/bettery/css/itao.css" />
		<script type="text/javascript"	src="${pageContext.request.contextPath}/dewei/js/jquery.js"></script>
		<script type="text/javascript"	src="${pageContext.request.contextPath}/bettery/js/jquery.validate.min.js"></script>
		<script type="text/javascript"	src="${pageContext.request.contextPath}/bettery/js/bettery_common.js"></script>
		<script type="text/javascript"	src="${pageContext.request.contextPath}/bettery/js/template.js"></script>
		<script type="text/javascript">
function closeWindow() {
	var ua = navigator.userAgent.toLowerCase();
	if (ua.match(/MicroMessenger/i) == "micromessenger") {
		WeixinJSBridge.call('closeWindow');
	} else {
		if (navigator.userAgent.indexOf("MSIE") > 0) {
			if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
				window.opener = null;
				window.close();
			} else {
				window.open('', '_top');
				window.top.close();
			}
		} else if (navigator.userAgent.indexOf("Firefox") > 0) {
			window.location.href = 'about:blank ';
		} else {
			$("#searchForm").submit();
		}
	}
}
</script>
	</head>
	<body onload="hideLoading()">
		<div class='search_bar'>
			<span class='new-btn right' onclick="closeWindow()"> <a>保存返回</a>
			</span>
		</div>
		<form id='searchForm' action="main.do" method="post">
			<div class="col-lg-12 m-t">
				<div id="successPage" class="inner" style="position: relative;"	align="center">
					<div style='color: red; font-size: 24px'>
						<b>恭喜您，预约成功！</b>
					</div>
					<div  style="margin-top: 10px; font-size: 12px;">
						您的订单号为：
						<b  style="font-size: 20px; color: red;">${model.dingDanUid}</b>
					</div>

					<div class='panel m-t' style='background: #E4E4E4'>
						<div		style='color: green; height: 30px; text-indent: 14px; 10 px 18px 0; line-height: 24px; text-align: left'>
							订单信息如下
						</div>
						<img src='${pageContext.request.contextPath}/bettery/icons/connect.png' width='100%' />
						<div class="panel-body" id="dingdanInfo" align="left">
						
						
						</div>
					</div>
					<div style="text-align: left; font-size: 13px;">
					</div>
				</div>
			</div>
		</form>

<script id="dingdanInfo_tmp" type="text/html">
<div class="mendianDiv" style="display: block;">
{{each list as value i}}
<table>
	<tbody><tr>
		<td>
          {{if value.imageUrl}}
				<img  class="photo" src="{{value.imageUrl}}"  height="60px" width="60px">
				{{else}}  
				<img  class="photo" src="${pageContext.request.contextPath}/bettery/img/category.jpg"  height="60px" width="60px">
		  {{/if}}
		</td>
		<td>
		    <div style="height: 20px; font-size: 13px; ">
				商品名称：<span id="showPinpai1">{{value.goodsName}}</span>
			</div>
			<div style="height: 20px; font-size: 13px; ">
				品牌型号：{{value.pinpai}}&nbsp;&nbsp;{{value.guige}}
			</div>
			<div style="height: 20px; font-size: 13px; ">
				购买数量：&nbsp;{{value.num}}
			</div>
		</td>
	</tr>
    </tbody>
</table>
<hr>
{{/each}}
{{if model.mendianId}}
 <table style="margin-left: 0px">
	<tbody>
	<tr>
	 <td style="width:60px;">
                {{if model.mendImgUrl}}
				<img  class="photo" src="{{model.mendImgUrl}}"  height="60px" width="60px">
				{{else}}  
				<img  class="photo" src="${pageContext.request.contextPath}/bettery/img/category.jpg"  height="60px" width="60px">
				{{/if}}
	 </td>
	 <td>
		 <div style="height: 20px; font-size: 13px; ">
		  门店名称：<span id="showName1">{{model.mendName}}</span>
		 </div>
		 <div style="height: 20px; font-size: 13px; ">
		  联&nbsp;系&nbsp;人：<span id="showLxr1">{{model.mendLxr}}</span>
		 </div>
		 <div style="height: 20px; font-size: 13px; ">
			联系电话：<span id="showLxTel1">{{model.mendLxTel}}</span>
		 </div>
	 </td>
	 </tr>
	 <tr>
	  <td colspan="2">
		<table border="0px;" cellpadding="0px;" cellspacing="0px;"><tbody><tr><td style="vertical-align: top;width:66px;">门店地址：</td><td><span id="showAddr1">江苏省无锡市锡山区东亭街道庄桥路锡沪东路15O号。</span></td></tr></tbody></table>           
	  </td>
	 </tr>
	</tbody>
</table>
<hr>
{{/if}}
 <table style="margin-left: 0px">
	<tbody>
    <tr>
	  <td>
		商品总价：<span><font style="font-size: 12px;" color="red">{{model.goodsPrice}}</font></span>
	  </td>
	 </tr>
     <tr>
	  <td>
		服务费用：<span><font style="font-size: 13px;" color="red">{{model.servicePrice}}</font></span>
	  </td>
	 </tr>
       <tr>
	  <td>
		总计费用：<span><font style="font-size: 13px;" color="red">{{model.allPrice}}</font></span>
	  </td>
	 </tr>
	 <tr>
	  <td>
		服务类型：<span id="showGenghuanType1"><font style="font-size: 13px;" color="red"><b>{{model.buyType}}</b></font></span>
	  </td>
	 </tr>
	</tbody>
</table>
<hr>

&nbsp;<font style="font-size: 12px" color="red">温馨提示：</font>
<br>
<table style="margin:0px;font-size: 12px;padding: 0px;">
	<tbody>
	<tr>
	<td style="vertical-align: top"><font color="red">*</font></td>
	<td style="margin:0px;padding: 0px;">点击“保存返回”，预约操作完成；</td>
	</tr>
	<tr>
    </tbody>
</table>
</div>
</script>
<script>
var json = ${json};
function FloatAdd(arg1,arg2){
	var r1,r2,m;  
	try{r1=arg1.toString().split(".")[1].length;}catch(e){r1=0;} 
	try{r2=arg2.toString().split(".")[1].length;}catch(e){r2=0;}
	m=Math.pow(10,Math.max(r1,r2)) ; 
	return (arg1*m+arg2*m)/m;
}
$(function(){
	if(null!=json&&null!=json.goods&&json.goods.length>0)
	{
		var goods=json.goods;
		for(var i=0;i<goods.length;i++){
			if(goods[i].cardprice){
				goods[i].cardprice=parseFloat(goods[i].cardprice,10).toFixed(2);
			}
		}
		json.allPrice=parseFloat(FloatAdd(json.servicePrice,json.goodsPrice),10).toFixed(2);
		json.goodsPrice=parseFloat(json.goodsPrice,10).toFixed(2);
		json.servicePrice=parseFloat(json.servicePrice,10).toFixed(2);
		var data={list:goods,model:json};
		var html = template('dingdanInfo_tmp', data);
		document.getElementById('dingdanInfo').innerHTML = html;
	}
});

</script>

</body>
</html>